import Taro from '@tarojs/taro'
import React, { useCallback } from 'react'
import { Text, View } from '@tarojs/components'
import Navigate from '@NAVIGATION/navigateManager'
import { Analytic_Type } from '@CONSTANTS/analytic'
import style from './RecommendPlan.module.scss'

const RecommendPlan: React.FC<{ isShowTopLine: boolean }> = ({
  isShowTopLine
}) => {
  const onClickMorePlan = useCallback(() => {
    Navigate.planList()
    Taro.tracker.trackEvent(Analytic_Type.num_see_more_plan.eventId)
  }, [])

  return (
    <View className={`${style.container} ${isShowTopLine ? style.topLine : ''}`}>
      <View className={style.containerClass}>
        <View className={style.block} />
        <Text className={style.rightTitle}>了解更多管理方案</Text>
      </View>
      <View className={style.moreClass} onClick={onClickMorePlan}>
        <Text className={style.moreTextClass}>去查看</Text>
      </View>
    </View>
  )
}

export default RecommendPlan
